package lab02.Text11;

/**
 * Created by Administrator on 2017/10/26.
 */
public class Square extends Rectangle{
   float side;
    Square(float side){
        super(side,side);
    }
    public String getTangle(){
        return "该正方形：\n"+"边长为："+this.length;
    }
    public String getDiag(){
        return "对角线长为："+Math.sqrt(2.0*this.length*this.length);
    }
    public void printMyWay(){
        super.printMyWay();
        System.out.println(this.getDiag());
    }
}
